package d1208.Ljs2.Ljs20;

import java.lang.reflect.Field;

public class Test {
    public static void main(String[] args) throws Exception{

        System.out.println(new Test().invokeMethod(new A(),"Ljs2.Ljs20.A",new Object[]{"sddc",15}));
    }
    public Object invokeMethod(Object obj, String methodName, Object[] args)  throws Exception{
//        Class<?> aClass = Class.forName(methodName);
        Class<?> aClass = obj.getClass();
        Field[] fields = aClass.getDeclaredFields();
        for (int i = 0; i < fields.length; i++) {
            fields[i].set(obj,args[i]);
        }
        return obj;
    }

}
